<?php

function compare($array1, $array2) {
	$distance = 0;	

	for($i = 0; $i < count($array1); $i++) {
	       $currdist = $array1[$i] - $array2[$i];
	       $distance += $currdist * $currdist;
	}

	$max = 16 * count($array1);
	return 10 - (10 * $distance / $max)
}

?>